package com.itheima.set;

import com.itheima.domain.Student;

import java.util.HashSet;

/*
HashSet存储并遍历学生
 */
public class Demo01 {
    public static void main(String[] args) {

        HashSet<Student> set = new HashSet<>();
        Student lu1 = new Student("鹿晗1", 30);
        Student lu2 = new Student("鹿晗1", 30);
        Student lu3 = new Student("鹿晗2", 30);
        Student lu4 = new Student("鹿晗3", 30);
        set.add(lu1);
        set.add(lu2);
        set.add(lu3);
        set.add(lu4);
        System.out.println(set);
    }

}
